import java.lang.reflect.Array;
import java.util.Arrays;

public class test1 {
    public static void main(String[] args) {
        int []arr=new int[]{1,5,4,8,2,10,6,7,9,3};
        for (int i = 0; i <arr.length ; i++) {

            for (int j =0; j <arr.length-i-1 ; j++) {
                 if(arr[j]>arr[j+1]){
                     int tmp =arr[j];
                     arr[j]=arr[j+1];
                     arr[j+1]=tmp;
                 }
            }
        }
        for (int x:arr) {
            System.out.print(x+" ");
        }

    }
}
